package com.netistate.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.netistate.base.BaseDao;
import com.netistate.pojo.UserProject;

@Repository
public class UserProjectDao extends BaseDao<UserProject, Integer>{

	/**
	 * 根据pid去UserProject找对应项目所对应的人
	 * @param pid
	 * @return UserProject
	 */
	@SuppressWarnings("unchecked")
	public List<UserProject> findUserProjectByPid(int pid) {
		String hql = "from UserProject where projectid = ?";
		Query query = getSession().createQuery(hql);
		query.setParameter(0, pid);
		return query.list();
	}



}
